$(function () {
    var mapChart = echarts.init(document.getElementById("echarts-map-chart"));
    var mapoption = {
        color: ['gold','aqua','lime'],
        title : {
            text: '北京疫情情况',
            x:'center'
        },
        tooltip : {
            trigger: 'item'
        },
        legend: {
            orient: 'vertical',
            x:'left',
            data:['现有确诊','累计治愈','累计确诊']
        },
        dataRange: {
            min: 0,
            max: 500,
            x: 'left',
            y: 'bottom',
            text:['高','低'],           // 文本，默认为数值文本
            calculable : true
        },
        toolbox: {
            show: true,
            orient : 'vertical',
            x: 'right',
            y: 'center',
            feature : {
                // mark : {show: true},
                dataView : {show: true, readOnly: false},
                restore : {show: true},
                saveAsImage : {show: true}
            }
        },
        roamController: {
            show: true,
            x: 'right',
            mapTypeControl: {
                '北京': true
            }
        },
        series : [
            {
                name: '现有确诊',
                type: 'map',
                mapType: '北京',
                zoom:1.0 ,
                roam: true,
                itemStyle:{
                    normal:{label:{show:true}},
                    emphasis:{label:{show:false}}
                },
                data:[
                    {name:'东城区',value:0},
                    {name:'西城区',value:7},
                    {name:'通州区',value:3},
                    {name:'大兴区',value:9},
                    {name: '密云县',value: 0},
                    {name: '怀柔区',value: 0},
                    {name: '丰台区',value: 23 },
                    {name: '石景山区',value: 0 },
                    {name: '门头沟区',value: 0},
                    {name: '昌平区', value: 1 },
                    {name: '朝阳区', value: 31},
                    {name: '海淀区',value: 12},
                    {name: '顺义区', value: 1 },
                    {name: '房山区',value: 6 },
                    {name: '平谷区',value:null },
                    {name: '延庆县',value: 0}
                ]
            },
            {
                name: '累计治愈',
                type: 'map',
                mapType: '北京',
                itemStyle:{
                    normal:{label:{show:true}},
                    emphasis:{label:{show:false}}
                },
                data:[
                    {name:'东城区',value:6},
                    {name:'西城区',value:6},
                    {name:'通州区',value:3},
                    {name:'大兴区',value:111},
                    {name: '密云县',value: 0},
                    {name: '怀柔区',value: 4},
                    {name: '丰台区',value: 286},
                    {name: '石景山区',value: 12},
                    {name: '门头沟区',value: 4},
                    {name: '昌平区', value: 50 },
                    {name: '朝阳区', value: 9},
                    {name: '海淀区',value: 26 },
                    {name: '顺义区', value: 45 },
                    {name: '房山区',value: 12},
                    {name: '平谷区',value:null },
                    {name: '延庆县',value: 0}
                ]
            },
            {
                name: '累计确诊',
                type: 'map',
                mapType: '北京',
                itemStyle:{
                    normal:{label:{show:true}},
                    emphasis:{label:{show:true}}
                },
                data:[
                    {name:'东城区',value:19},
                    {name:'西城区',value:66},
                    {name:'通州区',value:24},
                    {name:'大兴区',value:143},
                    {name: '密云县',value: 7},
                    {name: '怀柔区',value: 8},
                    {name: '丰台区',value: 349},
                    {name: '石景山区',value: 15},
                    {name: '门头沟区',value: 5},
                    {name: '昌平区', value: 70 },
                    {name: '朝阳区', value: 106},
                    {name: '海淀区',value: 102 },
                    {name: '顺义区', value: 46 },
                    {name: '房山区',value: 31},
                    {name: '平谷区',value:null },
                    {name: '延庆县',value: 1}
                ]
            }
        ]
    };
    mapChart.setOption(mapoption);
    $(window).resize(mapChart.resize);
});
